package com.asiainfo.integration.queue;

import org.dom4j.Element;

import java.io.Serializable;

/**
 * Usage:
 *
 * @author Charkey
 * @date 4/1/2016
 */
public class QueueDetails implements Serializable {

    private static final long serialVersionUID = -5057767884446632755L;

    private String interfaceName;

    private String initialContextFactory;

    private String connectionUrl;

    private String connectionFactory;

    private String queueName;

    private String username;

    private String password;

    public String getInterfaceName() {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    public String getInitialContextFactory() {
        return initialContextFactory;
    }

    public void setInitialContextFactory(String initialContextFactory) {
        this.initialContextFactory = initialContextFactory;
    }

    public String getConnectionUrl() {
        return connectionUrl;
    }

    public void setConnectionUrl(String connectionUrl) {
        this.connectionUrl = connectionUrl;
    }

    public String getConnectionFactory() {
        return connectionFactory;
    }

    public void setConnectionFactory(String connectionFactory) {
        this.connectionFactory = connectionFactory;
    }

    public String getQueueName() {
        return queueName;
    }

    public void setQueueName(String queueName) {
        this.queueName = queueName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void xmlElementToAttribute(Element element) {
        this.interfaceName = element.element("interfaceName").getText();
        this.initialContextFactory = element.element("initialContextFactory").getText();
        this.connectionUrl = element.element("connectionUrl").getText();
        this.connectionFactory = element.element("connectionFactory").getText();
        this.queueName = element.element("queueName").getText();
        this.username = element.element("username").getText();
        this.password = element.element("password").getText();
    }
}
